package com.itheima.job;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) throws ParseException {
        SimpleDateFormat birthdayFormat = new SimpleDateFormat("yyyy-MM-dd");
        Scanner sc = new Scanner(System.in);
        System.out.print("输入生日（例：2000-1-1）:");
        String birthday = sc.nextLine();
        Date birthdayDate = birthdayFormat.parse(birthday);
        long time = birthdayDate.getTime();
        System.out.println("生日的毫秒值：" + time);
        long time1 = new Date().getTime();
        System.out.println("当前日期时间对应的毫秒值" + time1);
        long l = time1 - time;
        System.out.println("你出生到现在一共：" + l/1000/60/60/24 + "天");
    }
}
